package com.silent.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.silent.properties.GirlProperties;

/**
 * @author Silent-Y
 * RestController等同于Responbody与Controller的组合
 */
//RestController等同于Responbody与Controller的组合
@RestController
@RequestMapping(value={"/hello","/hi"})
public class HelloController {
	
//	单个变量注入
//	@Value("${cupSize}")
//	private String cupSize;
//	
//	@Value("${age}")
//	private Integer age;
//	
//	文件内变量调用
//	@Value("${content}")
//	private String content;
	
//	文件变量转换为GirlProperties后注入
	@Autowired
	private GirlProperties girlProperties;
	
	@RequestMapping(value="/say/{id}",method=RequestMethod.GET)
	public String say(@PathVariable("id") Integer id){
		
		return "id:" + id;
		
//		System.out.println(cupSize + age + content);
		
//		System.out.println("girlProperties.getCupSize()");
//		return girlProperties.getCupSize() ;
//		return "index";
	}

}
